import re

def email():
    email_list=['xiaomei@163.com','xiaomei@163.comm','xiaomei@qq.com','小王@163.com']
    for email in email_list:
        ret=re.match('[a-zA-Z0-9_]{4,20}@163.com$',email)
        if ret:
            print('{}格式正确,匹配后的结果是{}'.format(email,ret.group()))
        else:
            print('{}格式不正确'.format(email))

email()